<template>
   <div id="app">
        父组件
        <hr>
        <router-link to='/'>首页</router-link> ||
        <router-link to='/a'>a页面</router-link> ||
        <router-link to='/b'>b页面</router-link>
        <!-- <router-view/> -->
        <!-- vue2    -->
        <!-- <keep-alive>
            <router-view/>
        </keep-alive> -->
        <!-- vue3 -->
        <router-view v-slot="{Component}">
            <keep-alive>
                <component :is="Component" />
            </keep-alive>
        </router-view>
   </div>
</template>
<script>
 
</script>
<style>
</style>


 
 
